import vue from "vue"

import VueRouter from "vue-router"

vue.use(VueRouter)

//把组件倒入 懒加载
const Home = () =>
    import ("../views/Home/Home.vue")
const fenlei = () =>
    import ("../views/fenlei/fenlei.vue")
const shopping = () =>
    import ("../views/shopping/shopping.vue")
const user = () =>
    import ("../views/user/user.vue")
const detail = () =>
    import ("../views/detail/detailitem.vue")
const newaa = () =>
    import ("../views/detail/detailitem.vue")

const router = new VueRouter({
    routes: [{
            path: "/",
            redirect: "/Home"
        },
        {
            path: "/Home",
            component: Home
        },
        {
            path: "/fenlei",
            component: fenlei
        },
        {
            path: "/shopping",
            component: shopping
        },
        {
            path: "/user",
            component: user
        },
        {
            path: "/detail/:iid",
            component: detail,
        }
    ],
})

export default router